From: Chaehyun Lim Date: Mon, 7 Sep 2015 15:36:36 +0000 (+0900) Subject: staging: wilc1000: linux_wlan.c: add kzalloc error check X-Git-Tag: archive/raspbian/4.9.13-1+rpi1~10^2~3505^2~2159 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=ac61ef86f971c3fd0d3aff59744423ff32c4fcca;p=linux-4.9.git staging: wilc1000: linux_wlan.c: add kzalloc error check This patch adds error check if kzalloc is failed. Signed-off-by: Chaehyun Lim Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c index de82a90c2949..d68b42cbd14c 100644 --- a/drivers/staging/wilc1000/linux_wlan.c +++ b/drivers/staging/wilc1000/linux_wlan.c @@ -2251,6 +2251,8 @@ int wilc_netdev_init(void) /*create the common structure*/ g_linux_wlan = kzalloc(sizeof(linux_wlan_t), GFP_KERNEL); + if (!g_linux_wlan) + return -ENOMEM; /*Reset interrupt count debug*/ int_rcvdU = 0;